package com.interview.elasticjob.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.config.autofig.ElasticSimpleJob;
import com.interview.elasticjob.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Function:
 * @Author: aqie
 * @Date: 2019/8/6 14:29
 */
@ElasticSimpleJob(
        jobName = "thirdOrderProduceJob",
        cron = "0/5 * * * * ?",
        shardingTotalCount = 1,
        overwrite = true
)
public class ThirdOrderProduceJob implements SimpleJob {
    @Autowired
    private OrderService orderService;
    @Override
    public void execute(ShardingContext shardingContext) {
        orderService.produceThirdOrder();
    }
}
